<template>
    <div class="income-template">
        <yd-navbar slot="navbar" title="基本信息" class="public-header">
            <span slot="left">
                <a href="javascript:window.history.go(-1)"><yd-navbar-back-icon></yd-navbar-back-icon></a>
            </span>
        </yd-navbar>
        <yd-slider autoplay="3000">
            <yd-slider-item v-for="item in data.shop.detail_pic">
                <a href="javascript:;">
                    <img :src="item">
                </a>
            </yd-slider-item>
        </yd-slider>
        <div class="income-content">
            <h3 class="income-title" v-show="data.shop.intro">店铺简介 [ 店铺：{{data.shop.name}} ]</h3>
            <article class="income-shop-desc" v-show="data.shop.intro">
                {{data.shop.intro}}!
            </article>
            <h3 class="income-title">开店成本</h3>
            <yd-cell-group title="拿店成本(元)">
                <yd-cell-item>
                    <span slot="left">转让费/进场费</span>
                    <span slot="right">{{data.shopInvest.enter}}</span>
                </yd-cell-item>
                <yd-cell-item>
                    <span slot="left">中介费/选址费</span>
                    <span slot="right">{{data.shopInvest.agency}}</span>
                </yd-cell-item>
            </yd-cell-group>
            <yd-cell-group title="开店成本(元)">
                <yd-cell-item>
                    <span slot="left">可折旧设备合计</span>
                    <span slot="right">{{data.shopInvest.old_device}}</span>
                </yd-cell-item>
                <yd-cell-item>
                    <span slot="left">不可折旧设备合计</span>
                    <span slot="right">{{data.shopInvest.not_old_device}}</span>
                </yd-cell-item>
                <yd-cell-item>
                    <span slot="left">装修合计</span>
                    <span slot="right">{{data.shopInvest.renovation}}</span>
                </yd-cell-item>
                <yd-cell-item>
                    <span slot="left">用品用具</span>
                    <span slot="right">{{data.shopInvest.tackle}}</span>
                </yd-cell-item>
                <yd-cell-item>
                    <span slot="left">开业耗材</span>
                    <span slot="right">{{data.shopInvest.open_supplies}}</span>
                </yd-cell-item>
                <yd-cell-item>
                    <span slot="left">开业费用</span>
                    <span slot="right">{{data.shopInvest.not_old_device}}</span>
                </yd-cell-item>
                <yd-cell-item>
                    <span slot="left">开业广告/促销</span>
                    <span slot="right">{{data.shopInvest.open_sum}}</span>
                </yd-cell-item>
                <yd-cell-item>
                    <span slot="left">培训费</span>
                    <span slot="right">{{data.shopInvest.train}}</span>
                </yd-cell-item>
                <yd-cell-item>
                    <span slot="left">加盟费</span>
                    <span slot="right">{{data.shopInvest.join_sum}}</span>
                </yd-cell-item>
                <yd-cell-item>
                    <span slot="left">金融服务费</span>
                    <span slot="right">{{data.shopInvest.finance_service}}</span>
                </yd-cell-item>
                <yd-cell-item>
                    <span slot="left">管理费用</span>
                    <span slot="right">{{data.shopInvest.manage}}</span>
                </yd-cell-item>
                <yd-cell-item>
                    <span slot="left">其他费用</span>
                    <span slot="right">{{data.shopInvest.others}}</span>
                </yd-cell-item>
            </yd-cell-group>
            <yd-cell-group title="流动资金(元)">
                <yd-cell-item>
                    <span slot="left">租赁押金</span>
                    <span slot="right">{{data.shopInvest.lease_deposit}}</span>
                </yd-cell-item>
                <yd-cell-item>
                    <span slot="left">产品库存</span>
                    <span slot="right">{{data.shopInvest.product_stock}}</span>
                </yd-cell-item>
                <yd-cell-item>
                    <span slot="left">预付租金</span>
                    <span slot="right">{{data.shopInvest.pre_lease}}</span>
                </yd-cell-item>
                <yd-cell-item>
                    <span slot="left">经营储备金</span>
                    <span slot="right">{{data.shopInvest.operate_sum}}</span>
                </yd-cell-item>
                <yd-cell-item>
                    <span slot="left">开店成本合计</span>
                    <span slot="right">{{data.shopInvest.all_count}}</span>
                </yd-cell-item>
            </yd-cell-group>
            <yd-cell-group title="本人投资">
                <yd-cell-item>
                    <span slot="left">本人投资金额</span>
                    <span slot="right">{{data.invest.price}} (元)</span>
                </yd-cell-item>
                <yd-cell-item>
                    <span slot="left">持本店股份</span>
                    <span slot="right">{{data.invest.stock_right_percent}}%</span>
                </yd-cell-item>
            </yd-cell-group>
        </div>
        <yd-tabbar slot="tabbar" class="public-footer">
            <yd-tabbar-item title="首页" link="/">
                <yd-icon name="home" slot="icon"></yd-icon>
            </yd-tabbar-item>
            <yd-tabbar-item title="投资收益" link="/income" active>
                <yd-icon name="shopcart-outline" slot="icon"></yd-icon>
            </yd-tabbar-item>
            <yd-tabbar-item title="信息交流" link="/message">
                <yd-icon name="like-outline" slot="icon"></yd-icon>
            </yd-tabbar-item>
            <yd-tabbar-item title="个人中心" link="/user">
                <yd-icon name="ucenter-outline" slot="icon"></yd-icon>
            </yd-tabbar-item>
        </yd-tabbar>
    </div>
</template>
<script>
    import Ajax from "../api/ajax.js"
    import dataURL from "../data/dataURL.js"
    export default {
        data() {
            return {
                queryID: '',
                loadBloean: true,
                data: {
                    invest: {
                        "user_id": '',
                        "shop_id": '',
                        "price": "",
                        "stock_right_percent": "",
                    },
                    shopInvest: {
                        "shop_id": '',
                        "enter": "",
                        "agency": "",
                        "get_shop_sum": "",
                        "old_device": "",
                        "not_old_device": "",
                        "renovation": "",
                        "tackle": "",
                        "open_supplies": "",
                        "open_sum": "",
                        "ad": "",
                        "train": "",
                        "join_sum": "",
                        "finance_service": "",
                        "manage": "",
                        "others": "",
                        "open_shop_sum": "",
                        "lease_deposit": "",
                        "pre_lease": "",
                        "product_stock": "",
                        "operate_sum": "",
                        "working_capital": "",
                        "all_count": "",
                    },
                    shop: {
                        "shop_id": '',
                        "name": "",
                        "address": "",
                        "area_size": "",
                        "cover_pic": [],
                        "detail_pic": [],
                        "tel": "",
                        "contact_name": "",
                        "amount": "",
                        "commission_percent": '',
                        "operate_percent": '',
                        "reserve_percent": '',
                        "pick_over": "",
                        "start_date": "",
                        "open_date": "",
                        "intro": "",
                    },
                }
            }
        },
        methods: {
            // 页面初始化调用
            async getData() {
                this.queryID = this.$route.query.id;
                let res = await Ajax.Post(dataURL.income.shopInfo, {
                    shop_id: this.queryID
                });
                this.data = res;
                console.log(res)
                this.loadBloean = false;
            },
        },
        computed: {
            showLoading() {
                if (this.loadBloean) {
                    this.$dialog.loading.open('很快加载好了');
                } else {
                    this.$dialog.loading.close();
                }
            }
        },
        mounted() {
            this.getData();
        }
    }

</script>